package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TCommonFileUrlMapper;
import com.ruoyi.system.domain.TCommonFileUrl;
import com.ruoyi.system.service.ITCommonFileUrlService;

/**
 * 文件链接Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-08
 */
@Service
public class TCommonFileUrlServiceImpl implements ITCommonFileUrlService 
{
    @Autowired
    private TCommonFileUrlMapper tCommonFileUrlMapper;

    /**
     * 查询文件链接
     * 
     * @param fileId 文件链接主键
     * @return 文件链接
     */
    @Override
    public TCommonFileUrl selectTCommonFileUrlByFileId(Long fileId)
    {
        return tCommonFileUrlMapper.selectTCommonFileUrlByFileId(fileId);
    }

    /**
     * 查询文件链接列表
     * 
     * @param tCommonFileUrl 文件链接
     * @return 文件链接
     */
    @Override
    public List<TCommonFileUrl> selectTCommonFileUrlList(TCommonFileUrl tCommonFileUrl)
    {
        return tCommonFileUrlMapper.selectTCommonFileUrlList(tCommonFileUrl);
    }

    /**
     * 新增文件链接
     * 
     * @param tCommonFileUrl 文件链接
     * @return 结果
     */
    @Override
    public int insertTCommonFileUrl(TCommonFileUrl tCommonFileUrl)
    {
        tCommonFileUrl.setCreateTime(DateUtils.getNowDate());
        return tCommonFileUrlMapper.insertTCommonFileUrl(tCommonFileUrl);
    }

    /**
     * 修改文件链接
     * 
     * @param tCommonFileUrl 文件链接
     * @return 结果
     */
    @Override
    public int updateTCommonFileUrl(TCommonFileUrl tCommonFileUrl)
    {
        tCommonFileUrl.setUpdateTime(DateUtils.getNowDate());
        return tCommonFileUrlMapper.updateTCommonFileUrl(tCommonFileUrl);
    }

    /**
     * 批量删除文件链接
     * 
     * @param fileIds 需要删除的文件链接主键
     * @return 结果
     */
    @Override
    public int deleteTCommonFileUrlByFileIds(Long[] fileIds)
    {
        return tCommonFileUrlMapper.deleteTCommonFileUrlByFileIds(fileIds);
    }

    /**
     * 删除文件链接信息
     * 
     * @param fileId 文件链接主键
     * @return 结果
     */
    @Override
    public int deleteTCommonFileUrlByFileId(Long fileId)
    {
        return tCommonFileUrlMapper.deleteTCommonFileUrlByFileId(fileId);
    }

    /**
     * 删除文件链接信息
     *
     * @param tCommonFileUrl 文件链接主键
     * @return 结果
     */
    @Override
    public int deleteTCommonFileUrlByBusinessIdAndKeyValue(TCommonFileUrl tCommonFileUrl)
    {
        return tCommonFileUrlMapper.deleteTCommonFileUrlByBusinessIdAndKeyValue(tCommonFileUrl);
    }

    /**
     * 删除文件链接信息
     *
     * @param fileUrl 文件链接主键
     * @return 结果
     */
    @Override
    public int deleteTCommonFileUrlByFileUrl(String fileUrl)
    {
        return tCommonFileUrlMapper.deleteTCommonFileUrlByFileUrl(fileUrl);
    }
}
